package com.ghh.base64;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;

import junit.framework.TestCase;

import org.apache.commons.codec.binary.Base64;

public class Base64Test extends TestCase {

	public void testEncode() throws UnsupportedEncodingException {
		byte[] code = Base64.encodeBase64("password".getBytes(Charset.forName("UTF-8")));
		System.out.println(new String(code));
		byte[] dcode = Base64.decodeBase64(new String("asd"));
		System.out.println(new String(dcode));
		System.out.println(Base64.isBase64(dcode));

	}
}
